package cn.bisoft.java.service.ext.httpclient;

import com.hengpeng.common.constant.Constant;
import com.hengpeng.common.msg.agentportal.TransMessage;

public class TransResult<T>
{
	private static final long serialVersionUID = -1791350429078814535L;

	private String code = Constant.TRANSACTION_RESPONSE_CODE_SUCCESS;

	private boolean isSuccess = true;

	private String message = Constant.TRANSACTION_RESPONSE_MESSAGE_SUCCESS;

	private TransMessage requestMessage;

	private TransMessage responseMessage;

	private T returnValue;

	public TransResult(String code, String message, T returnValue, TransMessage request, TransMessage response)
	{
		this.code = code;
		this.message = message;
		if (Constant.TRANSACTION_RESPONSE_CODE_SUCCESS.equalsIgnoreCase(code))
		{
			this.isSuccess = true;
		}
		else
		{
			this.isSuccess = false;
		}
		this.returnValue = returnValue;
		this.requestMessage = request;
		this.responseMessage = response;
	}

	public String getCode()
	{
		return code;
	}

	public Boolean getIsSuccess()
	{
		return isSuccess;
	}

	public String getMessage()
	{
		return message;
	}

	public TransMessage getRequestMessage()
	{
		return requestMessage;
	}

	public TransMessage getResponseMessage()
	{
		return responseMessage;
	}

	public T getReturnValue()
	{
		return returnValue;
	}

	public void setCode(String code)
	{
		this.code = code;
	}

	public void setIsSuccess(Boolean isSuccess)
	{
		this.isSuccess = isSuccess;
	}

	public void setMessage(String message)
	{
		this.message = message;
	}

	public void setRequestMessage(TransMessage requestMessage)
	{
		this.requestMessage = requestMessage;
	}

	public void setResponseMessage(TransMessage responseMessage)
	{
		this.responseMessage = responseMessage;
	}

	public void setReturnValue(T returnValue)
	{
		this.returnValue = returnValue;
	}

}
